const  fs  = require('fs');
const  path  = require('path');
const cwd = process.cwd();

function getProjectPath(...filePath) {

  return path.resolve(cwd, ...filePath);
}

function resolve(moduleName) {
  return require.resolve(moduleName);
}

function getZonnarCfg() {
    const configPath = getProjectPath('.antd-tools.config.js');
    if (fs.existsSync(configPath)) {
      return require(configPath);
    }
  
    return {};
  }

  module.exports = {
    getZonnarCfg,
    getProjectPath,
    resolve
  }